package com.glodon.paas.document.service;

import java.util.List;

import com.glodon.paas.account.api.bean.User;
import com.glodon.paas.document.api.bean.File;
import com.glodon.paas.document.api.bean.PublicToken;
import com.glodon.paas.document.api.bean.Share;
import com.glodon.paas.document.dao.domain.ShareEntity;
import com.glodon.paas.dto.DataTansitionObject;

public interface ShareService {

    PublicToken getPublicToken(String token);

    List<File> getFilesByShares(List<Share> shares, String orderBy, String orderType, boolean cascade);

    List<Share> getSharesForMe(String userId);

    List<Share> getSharesByMe(String userId);

    List<Share> getPublicShares(String userId);

    User shareFile(String userId, String fileId, String account, String privilege);

    void cancelShare(String userId, String fileId, String toUserId);

    void cancelShare(String userId, String fileId);

    String publish(String userId, String fileId);

    void cancelPublish(String userId, String fileId);

    List<User> getSharedUser(String userId, String fileId);

    List<DataTansitionObject> getNavigationByMe(String rootId, String fileId);

    List<DataTansitionObject> getNavigationForMe(String userId, String fileId);
    
    /**
     * 获取文件的共享信息:<br>
     * includePath = true  包含所有祖先目录上的共享信息<br>
     * includePath = false 只返回当前文件的共享信息<br>
     * 
     * @param userId
     * @param fileId
     * @param includePath 是否包含整个路径上的共享信息
     * @return
     */
    public List<ShareEntity> getSharesOnFile(String userId, String fileId, boolean includePath);
}
